<link rel="stylesheet" href="../../css/admin.css" type="text/css">
<div style="background-color: #FFF">
<?php
define('BASE_FRAMEWORK', $_SERVER['DOCUMENT_ROOT'] . "/admincms/AdminClass");
define('SITE_PATH', "/admincms/");
$conn = mysql_connect("localhost", "root", "");
mysql_select_db("prode");
include('Form.class.php');

$form = new Form();
$form->jsPath = "../../Javascript/";
$form->input_class = "t";
$form->createFactory();

$nombre = $form->factory->newText();
$nombre->name = 'nombre';
$nombre->label = "Nombre";
$form->add($nombre);

$tabla = $form->factory->newText();
$tabla->name = 'tabla';
$tabla->events->add("onchange", "alert('tabla: ' + this.value);");
$tabla->label = "Tabla";
$form->add($tabla);

$pk = $form->factory->newText();
$pk->name = 'pk';
$pk->label = "Primary Key";
$form->add($pk);

$cols = $form->factory->newText();
$cols->name = 'cols';
$cols->label = "Columnas";

$sql = "show columns from usuario";
$query = mysql_query($sql, $conn);
$opt = array();
while($row = mysql_fetch_object($query))
{
	$opt[$row->Field] = $row->Field;
}
$combo = $form->factory->newSelect();
$combo->size = 5;
$combo->value($opt);
$combo->events->add("onclick", $cols->js->value($cols->js->value() . " + ' | ' + this.value"));

$row1 = $form->factory->newRow();
$row1->add($cols);
$row1->add($combo);

$paginacion = $form->factory->newCheckBox();
$paginacion->name = 'paginacion';
$paginacion->label = "Paginacion";
$form->add($paginacion);

$form->add($row1);

$form->display();

?>
</div>